﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>注册</title>
    <link href="css/main.css" rel="stylesheet" type="text/css" />
    <link href="css/Jqbox.css" rel="stylesheet" type="text/css" />
    <link href="css/jquery.loadmask.css" rel="stylesheet" type="text/css" />
    <script src="Js/jquery-1.5.2.min.js" type="text/javascript"></script>
    <script src="Js/ligerui.min.js" type="text/javascript"></script>
    <script src="Js/jquery.dialog.js" type="text/javascript"></script>
    <script src="Js/jquery.loadmask.min.js" type="text/javascript"></script>
    <script src="Js/conmon.js" type="text/javascript"></script>
     <style type="text/css">
         /**/
         *{word-wrap:break-word;}
.cl:after{content:".";display:block;height:0;clear:both;visibility:hidden;}
.cl{zoom:1;}hr{display:block;clear:both;*margin-top:-8px !important;*margin-bottom:-8px !important;}
.altw{width:350px;}
.altw .fltc{margin-bottom:0;padding:8px;}

.wp{margin:0 auto;width:960px;}
#wp .wp{width:auto;}

 
 .f_c{}.f_c li{list-style:none;}
 .f_c hr.l{margin:0;}
 .f_c a{color:#4D7189;}
 .f_c .list{margin:0 auto 10px;width:570px;border-top:3px solid #CDCDCD;}
 .f_c .list th,.f_c .list td{padding:5px 2px;height:auto;border-bottom:1px dashed #CDCDCD;}
 .f_c .list .btns th,.f_c .list .btns td{border-bottom:none;}
 .f_c .th th,.f_c .th td{padding:10px 0;}
 .f_c .list th{background:none;}.nfl{height:auto !important;height:320px;min-height:320px;}
 .nfl .f_c{margin:60px auto;padding:20px;width:580px;border:3px solid #F2F2F2;background:#FFF;}
 .nfl .loginform{height:auto;}
 .nfl .clause{width:auto;height:auto;}
 

.wrap{width:100%;margin:0 auto;}
.wpRight{width:245px;float:right;}
.wpLeft{width:100%;float:left;}

        .edittable td.editcellmessage,.edittable td.editcellverify,.edittable td.editcell{ padding:5px;line-height:25px;}
        .edittable td.editcellmessage{ padding-left:20px;} 
        body { font-size:12px; background:white;}
         
    </style>
    <script type="text/javascript">

        $(function () {
            $("#form1").ligerForm();
            $("#Sex").ligerComboBox({ width: 140, slide: false });
            $("#txtDepartment").ligerComboBox({ width: 140, slide: false, data: null });
            $("#txtArea").ligerComboBox({
                width: 140,
                selectBoxWidth: 200,
                selectBoxHeight: 200, valueField: 'id', treeLeafOnly: false, slide: false,
                tree: { url: 'WebServer/UserManage.ashx?Action=AreaList', checkbox: false },
                onSelected: function (newvalue) {
                    $("#txtDepartment").ligerGetComboBoxManager().selectValue(0);
                    if (newvalue > 0) {
                        $.getJSON('WebServer/UserManage.ashx?Action=Department', { areaid: newvalue, Rnd: Math.random() }, function (data) {
                            $("#txtDepartment").ligerGetComboBoxManager().setData(data);
                        });
                    }

                }
            });
        });
       
        function chk() {
            var err = "";
            if ($.trim($("#txtUser").val()) == "")
            {
                err = "用户名不能为空!";
                showErrorTip(err);
                 
                return false;
            }
            err = "";
            if ($.trim($("#txtTel").val()) == "")
                err = "请输入手机号码!";

            else if (!chkMoblie($("#txtTel").val())) {
                err = "手机号码输入不正确"
            }
            if (err != "") {
                showErrorTip(err);
                return false;
            }
            if ($("#txtCode").val() == "") {
                err = "工号不能为空!";
                showErrorTip(err);
                return false;
            }
            if ($.trim($("#txtCode").val()) == "") {
                err = "工号不能为空!";
                showErrorTip(err);
                return false;
            }
            if ($.trim($("#txtBuM").val()) == "") {
                err = "不能为空!";
                showErrorTip(err);
                return false;
            }
            if ($.trim($("#txtArea").val()) == "") {
                err = "请选择区域!";
                showErrorTip(err);
                return false;
            }
            if ($.trim($("#txtArea").val()) == "") {
                err = "请选择区域!";
                showErrorTip(err);
                return false;
            }
            if ($.trim($("#txtDepartment").val()) == "") {
                err = "请选择职务!";
                showErrorTip(err);
                return false;
            }
            if ($.trim($("#txtPwd").val()) == "") {
                err = "请输入密码!";
                showErrorTip(err);
                return false;
            }
            if ($("#txtPwd").val() != $("#txtPwdR").val()) {
                err = "密码不一致!";
                showErrorTip(err);
                return false;
            }
            return true;
        }
        function Save() {
            if (chk()) {
                var user = $("#txtUser").val();
                var sex = $("#Sex").val();
                var tel = $("#txtTel").val();
                var code = $("#txtCode").val();
                var bm = $("#txtBuM").val();
                var email = $("#txtMail").val();
                var are = $("#txtArea").val();
                var areid=$("#txtArea_val").val();
                var zw = $("#txtDepartment").val();
                var zwid=$("#txtDepartment_val").val();
                var pwd = $("#txtPwd").val();
                var pars = { user: user, sex: sex, tel: tel, code: code, bm: bm, email: email, are: are, areid: areid, zw: zw, zwid: zwid, pwd: pwd };
                $("#form1").mask("数据处理中，请稍候......");

                $.getJSON('WebServer/UserManage.ashx?Action=Reg', pars, function (data) {
                    $("#form1").unmask();
                    if (data.IsSuccess == 1) {
                        showAlertOk("数据注册成功");
                        parent.window.parent.window.CloseReg();
                    } else {
                        showErrorTip(data.Msg);

                    }
                });
            }
        }
    </script>
</head>
<body>
<form id="form1"  action="">
<div id="dpcontent" class="dpcontent wrap">
                            <div class="f_c altw" style="margin:0 auto;">
                                <table cellpadding="0" border="0" cellspacing="0" class="edittable">
                                <tr>
                                 <td  class="editcellmessage">用户名:</td>
                                 <td  class="editcellmessage"><input id="txtUser" name="txtUser" type="text"  ltype="text" /></td>
                                </tr>
                                <tr>
                                 <td  class="editcellmessage">性别:</td>
                                 <td  class="editcellmessage">
                                  <select name="Sex" id="Sex" >
                                   <option value="1">男</option>
                                    <option value="0">女</option>
                                    </select>
                                 </td>
                                </tr>
                                <tr>
                                 <td  class="editcellmessage">电话:</td>
                                 <td  class="editcellmessage"><input id="txtTel" name="txtTel" type="text" ltype="text" /></td>
                                </tr>
                                <tr>
                                 <td  class="editcellmessage">工号:</td>
                                 <td  class="editcellmessage"><input id="txtCode" name="txtCode" type="text" ltype="text" /></td>
                                </tr>
                                <tr>
                                 <td  class="editcellmessage">工作部门:</td>
                                 <td  class="editcellmessage"><input id="txtBuM" name="txtBuM" type="text" ltype="text" /></td>
                                </tr>
                                <tr>
                                 <td  class="editcellmessage">Email:</td>
                                 <td  class="editcellmessage"><input id="txtMail" name="txtMail" type="text" ltype="text" /></td>
                                </tr>
                                <tr>
                                 <td  class="editcellmessage">区域:</td>
                                 <td  class="editcellmessage">
                                  <input id="txtArea" name="txtArea" type="text"  />
                                 </td>
                                </tr>
                                <tr>
                                 <td  class="editcellmessage">职务:</td>
                                 <td  class="editcellmessage">
                                 <input id="txtDepartment" name="txtDepartment" type="text"  />
                                 </td>
                                </tr>
                                <tr>
                                 <td  class="editcellmessage">密码:</td>
                                 <td  class="editcellmessage"><input id="txtPwd" name="txtPwd" type="password" ltype="text" /></td>
                                </tr>
                                <tr>
                                 <td  class="editcellmessage">重复密码:</td>
                                 <td  class="editcellmessage"><input id="txtPwdR" name="txtPwdR" type="password"  ltype="text"/></td>
                                </tr>

                                <tr>
                                  <td  class="editcellmessage"></td>
                                  <td  class="editcellmessage"><input type="button" id="btnGet" value="提交" class="l-button" onclick="Save();"/>
                                </td>
                                </tr>
                                </table>
                          </div>
   </div>
</form>
</body>
</html>
